<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <router-view></router-view>
    
  </div>

  <script src="vue.js"></script>
  <script src="./vue-router.js"></script>

  <script>
    const 组件 = {

    }

    const routes = [
      {
        path: '/',
        component: 组件
      }
    ]
    const router = new VueRouter({
      routes    
    })
    const app = new Vue({
      el: '#app',
      router
    })


 const demo1 = {
   template:`
    <div></div>
   `
 }

 const routers = [
   {
    path:"/demo1/:id",
    component:demo1
 },
   {
     path:'/demo2',
     component:demo2
   }

 ]
    const route = new VueRoute({
      routers
    })
  
    const app = new Vue({
      el:'#app',
      route
    })
  </script>
</body>
</html>